<?php

function unauthorized($msg = '') {
  header('HTTP/1.1 401 Unauthorized');
  die;
}

function get_file_full_url($path) {
  if (strpos($path, "http") === 0) {
    return $path;
  } else {
    $root = cmf_get_domain() . cmf_get_root();
    if (strpos($path, "/") === 0) {
      return $root . $path;
    } else {
      return $root . '/' . $path;
    }
  }
}
